<template>
<div class="jiesuan">

<h2>结算管理</h2>

<el-form :model="form" :inline="true">
  <el-form-item label="对账批次">
    <el-input v-model="form.checkBatchNo"></el-input>
  </el-form-item>

  <el-button type="warning" @click="initData()">查询</el-button>
</el-form>

<div style="width: 700px">
  <el-table
    :data="tableData"
    style="border: 1px solid black"
    @selection-change="handleSelectionChange">
    <el-table-column
      type="selection"
      width="55">
    </el-table-column>
    <el-table-column
      prop="checkBatchNo"
      label="对账批次"
      width="180">
    </el-table-column>
    <el-table-column
      prop="businessName"
      label="商户名称"
      width="180">
    </el-table-column>
    <el-table-column
      prop="amount"
      label="结算金额">
    </el-table-column>
    <el-table-column
      prop="tradeDateZf"
      label="交易日期">
    </el-table-column>
  </el-table><br>

  <el-button type="warning" style="float: right" @click="jiesuan">确认结算</el-button>

</div>

</div>
</template>

<script>
import {allList} from "@/api/wishu/jiesuan";
export default {
  name: "index",
  data(){
    return{
      form:{},
      tableData:[],
      multipleSelection:[]
    }
  },
  created() {
    this.initData();
  },
  methods:{
    initData(){
      allList(this.form).then((res)=>{
        this.tableData=res;
      })
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    jiesuan(){
      if(this.multipleSelection == null || this.multipleSelection.length < 1){
        this.$message.error('请选择您要结算的信息！');
      }else{
        var aa = this.multipleSelection.map(x=>x.id).join(",");

      }
    }
  }
}
</script>

<style scoped>

</style>
